package com.kunbo.cn.controller.system;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kunbo.cn.dao.system.UserTestDao;
import com.kunbo.cn.entity.system.UserTest;
@RestController
@RequestMapping("/user")
public class UserTestController {
	@Autowired
	private UserTestDao userTestDao;
 
	@RequestMapping("/add")
	public Object add(@RequestParam(name = "name", required = true) String name) {
		UserTest user = new UserTest();
		user.setName(name);
		userTestDao.save(user);
		return user;
	}
 
	@RequestMapping("/list")
	public Object list() {
		Iterable<UserTest> users = userTestDao.findAll();
		return users;
	}


}
